
#include "chat_data_mgr.h"
#include "chat_data_json_config.h"
chat_data_mgr::chat_data_mgr()
{
	init();
}

chat_data_mgr* chat_data_mgr::instance_p = NULL;
chat_data_mgr* chat_data_mgr::instance()
{
	if( NULL == instance_p )
	{
		instance_p = new chat_data_mgr;
	}
	return instance_p;
}

void chat_data_mgr::init(void)
{
	chat_data_vec.clear();
	chat_data_json_config::instance()->load_chat_data_cfg( chat_data_vec, "");
}

void  chat_data_mgr::get_chat_data( int id, chat_data& chat_d )
{
	std::vector< chat_data >::iterator it;
	for( it = chat_data_vec.begin(); it != chat_data_vec.end(); ++it )
	{
		if( it->get_id() == id )
			chat_d = *it;	
	}
	return ;
}





